<?

$tmppath="../";

 REQUIRE($tmppath."protect/connect_jeu.php");


$JOUEUR=163;
$UNIT_ID=94;
$LOC_X=183;
$LOC_Y=79;
$NOMBRE=1;


$query="SELECT unite_name,unite_icon,unite_style2, unite_deplacement, unite_depla_max,
 unite_action, unite_style, unite_style2, unite_pex,unite_entretient,unite_action
 FROM uunite where unite_id=$UNIT_ID";
// 0 = name , 1 = images  2 = style 3= nbr depla 4 = max depla 5= action  6=style(engager/invoquer) 7=style de deplacement 8=Pex gagenr lors de sa creation ou de sa destruction 9 cout enrolement par unit&.
//echo $query;
$resultat3=mysql_query($query);
$tmp2=mysql_fetch_array($resultat3);

$query="SELECT unite_agi,unite_end,unite_for, unite_int, unite_pou, unite_taille,unite_deg_min,unite_deg_max,
unite_classe,unite_name FROM uunite where unite_id=$UNIT_ID";
$resultat2=mysql_query($query);
$tmp4=mysql_fetch_array($resultat2);
$agi=$tmp4[0];
$end=$tmp4[1];
$for=$tmp4[2];
$int=$tmp4[3];
$pou=$tmp4[4];
$taille=$tmp4[5];
$race=0;
$degat_min=$tmp4[6];
$degat_max=$tmp4[7];
$classe=$tmp4[8];
$UNITE_NAME=$tmp4[8];

//Calcul de l'attaque de la defence et des pv de l'unite.
//*******************************************************
$att=$for;
$def=$end;
$pv=$end;


$query="INSERT INTO sdunite (unite_unit_id,unite_user,
unite_sloc,unite_loc_x, unite_nombre, unite_name, unite_icon, unite_style, unite_depla_nbr
, unite_depla_max, unite_depla_now, unite_action,
unite_agi,unite_end,unite_for,unite_int,unite_pou,unite_taille,
unite_att,unite_def,unite_pv,unite_pvmax, unite_race, unite_depla_style,
unite_deg_min,unite_deg_max,unite_classe,unite_ville,unite_entretient,
unite_moral,unite_loc_y,unite_action)
 VALUES ($UNIT_ID,$JOUEUR,
 'm',$LOC_X,$NOMBRE,'$tmp2[0]','$tmp2[1]','$tmp2[6]','$tmp2[3]',$tmp2[4]
 ,$tmp2[3],'',
$agi,$end,$for,$int,$pou,$taille,
$att,$def,$pv,$pv, $race,'$tmp2[2]',
$degat_min,$degat_max,$classe,0,$tmp2[9],
 0,$LOC_Y,$tmp2[10])";
 echo $query;
           $resultat2=mysql_query($query);




?>
